<?php
class Helper_Plu_Number
{
	/**
	 * 插件状态
	 * @var bool
	 */
	static $status = true;
	
	
	/**
	 * 编号前缀验证
	 */
	static function checkNumberPrefix($number_prefix, $parent_id)
	{	
		if($number_prefix)
		{
			$category = Product_Categories::find("number_prefix=?", $number_prefix)->asArray()->getOne();
			if($category) return false;
		}else{
			return false;
		}
		return true;
	}
	
	/**
	 * 获取分类编码前缀
	 */
	static function getNumberPrefixByCategoryId($id)
	{
		$category = Product_Categories::find("id=?", $id)->asArray()->getOne();
		if($category) return $category['number_prefix'];
		return false;
	}
	
}